package com.xm.shop.payconfig;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfigInfo
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfigInfo {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000119602127";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCSf++qJTCsbu4+olvhNt/pFEadjfgS3hvEMr1wxLFfcfgrH0P76KLstRNR38bTPFIMLIxIwSLTf/cvS473pYG/CjshxYP8N8r3VbYE7bjXriM3q6pEPda0dYldUOx7jLfDuMKFJXvkd5SOkcuL3oZl+4v0CPmIT27Uqs7gTBuQCqXZscmdUOXKPqDZZdORh8vTqeOlFtFU3oWarR3eE34v2JVg4LhQKJXfK8ZX6qu2092gWpSo7KakeppCrKkshRTPA4fFSRlzB6S/y3ZUQ/V0YeiFwjbNavfcxi3vrWj7bMG4IbeeZ7LdgIDbaay+qH50huuli/my1mBOW5XJBlFZAgMBAAECggEAYyQfTdazNM4xfsOjSCs5pmNpUnBkJGiZA9KOr0T9ACmBl7Ul7dFGiMgV1f+JbyRQJhrzqLzDU7wyzJfmnaMsxdsnnzgqlMIxIeaoMnep8pPPE3qh1GLA7Qjpt/PuxcG6DsL3KOHwEPH33++8fuBNtbBgyvpT3DJdP6CENfhrYrM7SyAT/nP4sD5uSprTjjj9ckonj7xEoIRCs/T+RXUTzkjwjI9QfXfudQz/unLXCpdr2rT7sxGVQ+dLUJm+2GmcSDPn3nAOh/KmP2I2gdWb8ieisyAbh3FODrmtqQf3UAeFPvNtTe/A2Oy05DT5+KZjAVKZHlUQWAggjiJKTykT8QKBgQDPGapoOTqgemRXcDvJLN8tNAMhWJmCll+r8i9h2KWGxsOXJKF+jGQBQMxPjSp7d27/wHSL5iYLPUbhVK2B3kxvl6FZmASv2UNYtDvGw7n+MnCWsyz5XPwhYvyY14WnjpRAgTtfpxe6SfUohGz22B8sQ08w27sxIISbSKSA4DMLdQKBgQC1Fznxk2swiWlnXjPG+upveC2V3BhugO+zMnnO3tLQ0N3Rdrmrb8fn3U9EyQ/etraC0AmlXUbliChfg52qVQYkFUxHzZmsQ1VypKuYPrH025T+wdVV9jnr9xikIG3N4ahLValQN78UgPjfVskv+729ZN/0vDchj138YCdksfKF1QKBgE/CeraZE9MqT+q89smL1of6OBpnnPeGImJ+a3ErltRJSJq1KN0sBHfXFNiubWYPoVguLrSSdqRtfRbbHdeeXaG8rA9tVKDE9AL9pufuCXu0wVfIudFv1kqlbNMQbhESAFa3br5wA9tjEGACYFTQ93B8m8sdVQKem3OSjohz0DThAoGACn3nAIUO/8fmUHPXwh6FeKHY2kbfL3/O4234OrEUO77uKxWa2kDmrxtWXWDcx4WEe328IVWPJvtFg4snllfIvExzl/FkhuN7zuGVg4OWYd5a+ouWZZ2Xa4Fsbw3l7ri1PHAhGCGys2hpgt8PVvVZ3+A5TX+eHhalVlrnzWC18WUCgYEAlA9PYq68MWzeMeS7TmppfTodwMOZ8g4nuZDEdwACfZxpCzC/a6InPSyjskPojR64+90o9wJtlcqwcgIzTA9U8X57Znl3nXkAAICe6XR0AfXUiYWaJJugAVuce7iic07dK9qt2E2+IhP/sWPEAA00W/vmHjme4PEIIetNW+txcdQ=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAixrIYF6dCF6qxklSSzgapHM+zFh/hlsZfyKhjBnF+zGJwuDaTiBRxzyneCMUjAsiHSEv5GtRljBAiASir5Ma7WZqD5ONCVpmOTyL8us9+NU8gijogSIxjEFM/YKveVNXAjfuMxTXfBUhW2n2g0atCo99xO/RUnr/NfhFMEl7A7KsqneBm6SBkQO/IWZjAqZyRqmsMt81AhHPeoy9DEKVrBzPTOn7jHLDGKe527bgIfGztuOiVs1UJ0dh7lBA2+xXROPwySaZI4i/y5F38NCJPEk5HfWJju/TqLQC4Mu5E/nL7AMdlqTpKXhuN5stvpwc91OFC0+vwMUghPAjVXGOMwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://pc5zaz.natappfree.cc/shop_api/pay/notify_url";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/shop_api/pay/return_url";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "/Users/jan/idea/shop/shop-api/log";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

